
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>CSS考察: ab外边距重叠</title>
    <style>
        .a {
            width: 200px;
            height: 100px;
            margin: 10px;
            background: #f00;
            overflow: hidden;
        }

        .b {
            width: 100px;
            height: 50px;
            margin: 20px;
            background: #00f;
            padding: 10%;
        }
    </style>
</head>

<body>
    <div class="a">
        <div class="b"></div>
    </div>
</body>

</html>